package com.zhilianbao.leyaogo.model.response.category;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 商品详情页面
 * <p>
 * Created by gyt on 2016/11/23
 */
public class GoodsDetails implements Parcelable {


    /**
     * goodsId : 32
     * supplierId : 1237
     * goodsSkuId : null
     * shopId : 1238
     * classifyId : 28
     * customClassifyId : 10
     * brandId : 0
     * goodsClassify : 0
     * goodsType : 1
     * goodsSn : ge01
     * goodsName : Apple iPhone 7
     * goodsFullName : Apple iPhone 7 128G 金色
     * goodsPic : 496508b4d5000db6fac075bc944946e7.jpg
     * goodsDesc : Apple iPhone 7 128G 金色
     * goodsSign :
     * unit : 台
     * stockType : 2
     * stockNumber : 3
     * stockWarn : 8
     * mPrice : 5200
     * price : 4000
     * limitNumber : 0
     * sortIndex : 1
     * isHot : 0
     * enshrineNumber : 3
     * saleNumber : 0
     * voucherNumber : 0
     * saleTimeType : 0
     * saleDtm : 1262275200000
     * statusCode : 1
     * deleteFlag : 0
     * comments : null
     * goodsProperty : []
     * goodsFile : [{"goodsFileId":69,"shopFileId":220,"goodsId":32,"goodsSkuId":0,"fileType":0,"fileName":"57d0c55bNa8230260.jpg","fileSMd5":null,"fileMd5":"496508b4d5000db6fac075bc944946e7.jpg","goodsFileType":1,"comments":null},{"goodsFileId":70,"shopFileId":220,"goodsId":32,"goodsSkuId":0,"fileType":0,"fileName":"57d0c55bNa8230260.jpg","fileSMd5":null,"fileMd5":"496508b4d5000db6fac075bc944946e7.jpg","goodsFileType":0,"comments":null}]
     * orderVoucher : []
     * isEnshrine : 0
     * skuMap : [{"goodsSkuMapId":40,"goodsId":32,"skuId":11,"skuName":"容量","comments":null,"strVal1":"","goodsSkuMapItemResponse":[{"goodsSkuMapItemId":89,"goodsSkuMapId":40,"skuId":11,"itemId":27,"itemName":"16G","comments":null},{"goodsSkuMapItemId":90,"goodsSkuMapId":40,"skuId":11,"itemId":28,"itemName":"32G","comments":null},{"goodsSkuMapItemId":91,"goodsSkuMapId":40,"skuId":11,"itemId":29,"itemName":"64G","comments":null},{"goodsSkuMapItemId":92,"goodsSkuMapId":40,"skuId":11,"itemId":30,"itemName":"128G","comments":null}]},{"goodsSkuMapId":39,"goodsId":32,"skuId":10,"skuName":"颜色","comments":null,"strVal1":"","goodsSkuMapItemResponse":[{"goodsSkuMapItemId":86,"goodsSkuMapId":39,"skuId":10,"itemId":24,"itemName":"金色","comments":null},{"goodsSkuMapItemId":87,"goodsSkuMapId":39,"skuId":10,"itemId":25,"itemName":"黑色","comments":null},{"goodsSkuMapItemId":88,"goodsSkuMapId":39,"skuId":10,"itemId":26,"itemName":"银色","comments":null}]}]
     * stockStatus : 0
     * sku : [{"goodsSkuId":38,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-金色 16G","goodsSkuFullName":"Apple iPhone 7-金色 16G","itemIds":"24-27","itemVals":"金色-16G","mPrice":4000,"price":4000,"stockNumber":3,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":39,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-金色 32G","goodsSkuFullName":"Apple iPhone 7-金色 32G","itemIds":"24-28","itemVals":"金色-32G","mPrice":4500,"price":4500,"stockNumber":1,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":40,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-金色 64G","goodsSkuFullName":"Apple iPhone 7-金色 64G","itemIds":"24-29","itemVals":"金色-64G","mPrice":4800,"price":4800,"stockNumber":3,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":41,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-金色 128G","goodsSkuFullName":"Apple iPhone 7-金色 128G","itemIds":"24-30","itemVals":"金色-128G","mPrice":5200,"price":5200,"stockNumber":1,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":42,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-黑色 16G","goodsSkuFullName":"Apple iPhone 7-黑色 16G","itemIds":"25-27","itemVals":"黑色-16G","mPrice":4000,"price":4000,"stockNumber":1,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":43,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-黑色 32G","goodsSkuFullName":"Apple iPhone 7-黑色 32G","itemIds":"25-28","itemVals":"黑色-32G","mPrice":4500,"price":4500,"stockNumber":0,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":1,"comments":null},{"goodsSkuId":44,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-黑色 64G","goodsSkuFullName":"Apple iPhone 7-黑色 64G","itemIds":"25-29","itemVals":"黑色-64G","mPrice":4800,"price":4800,"stockNumber":3,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":45,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-黑色 128G","goodsSkuFullName":"Apple iPhone 7-黑色 128G","itemIds":"25-30","itemVals":"黑色-128G","mPrice":5200,"price":5200,"stockNumber":1,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":46,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-银色 16G","goodsSkuFullName":"Apple iPhone 7-银色 16G","itemIds":"26-27","itemVals":"银色-16G","mPrice":4000,"price":4000,"stockNumber":1,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":2,"comments":null},{"goodsSkuId":47,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-银色 32G","goodsSkuFullName":"Apple iPhone 7-银色 32G","itemIds":"26-28","itemVals":"银色-32G","mPrice":4500,"price":4500,"stockNumber":0,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":1,"comments":null},{"goodsSkuId":48,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-银色 64G","goodsSkuFullName":"Apple iPhone 7-银色 64G","itemIds":"26-29","itemVals":"银色-64G","mPrice":4800,"price":4800,"stockNumber":0,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":1,"comments":null},{"goodsSkuId":49,"goodsId":32,"goodsSn":"","goodsSkuName":"Apple iPhone 7-银色 128G","goodsSkuFullName":"Apple iPhone 7-银色 128G","itemIds":"26-30","itemVals":"银色-128G","mPrice":5200,"price":5200,"stockNumber":0,"saleNumber":0,"statusCode":0,"deleteFlag":0,"stockStatus":1,"comments":null}]
     */

    private int                   goodsId;
    private int                   supplierId;
    private int                   goodsSkuId;
    private int                   selectedSkuId;//默认之前被选中的规格所对应的goodsSkuId
    private int                   shopId;
    private int                   classifyId;
    private int                   customClassifyId;
    private int                   brandId;
    private int                   goodsClassify;
    private int                   goodsType;
    private String                goodsSn;
    private String                goodsName;
    private String                goodsFullName;
    private String                goodsPic;
    private String                goodsDesc;
    private String                goodsSign;
    private String                unit;
    private int                   stockType;
    private int                   stockNumber;
    private int                   stockWarn;
    private double                mPrice;
    private double                price;
    private int                   limitNumber;
    private int                   sortIndex;
    private int                   isHot;
    private int                   enshrineNumber;
    private int                   saleNumber;
    private int                   voucherNumber;
    private int                   saleTimeType;
    private long                  saleDtm;
    private int                   statusCode;
    private int                   deleteFlag;
    private String                comments;
    private int                   isEnshrine;
    private int                   stockStatus;
    private List<?>               goodsProperty;
    /**
     * goodsFileId : 69
     * shopFileId : 220
     * goodsId : 32
     * goodsSkuId : 0
     * fileType : 0
     * fileName : 57d0c55bNa8230260.jpg
     * fileSMd5 : null
     * fileMd5 : 496508b4d5000db6fac075bc944946e7.jpg
     * goodsFileType : 1
     * comments : null
     */

    private List<GoodsFileEntity> goodsFile;
    private List<?>               orderVoucher;
    /**
     * goodsSkuMapId : 40
     * goodsId : 32
     * skuId : 11
     * skuName : 容量
     * comments : null
     * strVal1 :
     * goodsSkuMapItemResponse : [{"goodsSkuMapItemId":89,"goodsSkuMapId":40,"skuId":11,"itemId":27,"itemName":"16G","comments":null},{"goodsSkuMapItemId":90,"goodsSkuMapId":40,"skuId":11,"itemId":28,"itemName":"32G","comments":null},{"goodsSkuMapItemId":91,"goodsSkuMapId":40,"skuId":11,"itemId":29,"itemName":"64G","comments":null},{"goodsSkuMapItemId":92,"goodsSkuMapId":40,"skuId":11,"itemId":30,"itemName":"128G","comments":null}]
     */

    private List<SkuMapEntity>    skuMap;
    /**
     * goodsSkuId : 38
     * goodsId : 32
     * goodsSn :
     * goodsSkuName : Apple iPhone 7-金色 16G
     * goodsSkuFullName : Apple iPhone 7-金色 16G
     * itemIds : 24-27
     * itemVals : 金色-16G
     * mPrice : 4000
     * price : 4000
     * stockNumber : 3
     * saleNumber : 0
     * statusCode : 0
     * deleteFlag : 0
     * stockStatus : 2
     * comments : null
     */

    private List<SkuEntity>       sku;

    protected GoodsDetails(Parcel in) {
        goodsId = in.readInt();
        supplierId = in.readInt();
        shopId = in.readInt();
        classifyId = in.readInt();
        customClassifyId = in.readInt();
        brandId = in.readInt();
        goodsClassify = in.readInt();
        goodsType = in.readInt();
        goodsSn = in.readString();
        goodsName = in.readString();
        goodsFullName = in.readString();
        goodsPic = in.readString();
        goodsDesc = in.readString();
        goodsSign = in.readString();
        unit = in.readString();
        stockType = in.readInt();
        stockNumber = in.readInt();
        stockWarn = in.readInt();
        mPrice = in.readInt();
        price = in.readInt();
        limitNumber = in.readInt();
        sortIndex = in.readInt();
        isHot = in.readInt();
        enshrineNumber = in.readInt();
        saleNumber = in.readInt();
        voucherNumber = in.readInt();
        saleTimeType = in.readInt();
        saleDtm = in.readLong();
        statusCode = in.readInt();
        deleteFlag = in.readInt();
        isEnshrine = in.readInt();
        stockStatus = in.readInt();
    }

    public static final Creator<GoodsDetails> CREATOR = new Creator<GoodsDetails>() {
        @Override
        public GoodsDetails createFromParcel(Parcel in) {
            return new GoodsDetails(in);
        }

        @Override
        public GoodsDetails[] newArray(int size) {
            return new GoodsDetails[size];
        }
    };

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public int getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(int supplierId) {
        this.supplierId = supplierId;
    }

    public int getGoodsSkuId() {
        return goodsSkuId;
    }

    public void setGoodsSkuId(int goodsSkuId) {
        this.goodsSkuId = goodsSkuId;
    }

    public int getSelectedSkuId() {
        return selectedSkuId;
    }

    public void setSelectedSkuId(int selectedSkuId) {
        this.selectedSkuId = selectedSkuId;
    }

    public int getShopId() {
        return shopId;
    }

    public void setShopId(int shopId) {
        this.shopId = shopId;
    }

    public int getClassifyId() {
        return classifyId;
    }

    public void setClassifyId(int classifyId) {
        this.classifyId = classifyId;
    }

    public int getCustomClassifyId() {
        return customClassifyId;
    }

    public void setCustomClassifyId(int customClassifyId) {
        this.customClassifyId = customClassifyId;
    }

    public int getBrandId() {
        return brandId;
    }

    public void setBrandId(int brandId) {
        this.brandId = brandId;
    }

    public int getGoodsClassify() {
        return goodsClassify;
    }

    public void setGoodsClassify(int goodsClassify) {
        this.goodsClassify = goodsClassify;
    }

    public int getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(int goodsType) {
        this.goodsType = goodsType;
    }

    public String getGoodsSn() {
        return goodsSn;
    }

    public void setGoodsSn(String goodsSn) {
        this.goodsSn = goodsSn;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsFullName() {
        return goodsFullName;
    }

    public void setGoodsFullName(String goodsFullName) {
        this.goodsFullName = goodsFullName;
    }

    public String getGoodsPic() {
        return goodsPic;
    }

    public void setGoodsPic(String goodsPic) {
        this.goodsPic = goodsPic;
    }

    public String getGoodsDesc() {
        return goodsDesc;
    }

    public void setGoodsDesc(String goodsDesc) {
        this.goodsDesc = goodsDesc;
    }

    public String getGoodsSign() {
        return goodsSign;
    }

    public void setGoodsSign(String goodsSign) {
        this.goodsSign = goodsSign;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getStockType() {
        return stockType;
    }

    public void setStockType(int stockType) {
        this.stockType = stockType;
    }

    public int getStockNumber() {
        return stockNumber;
    }

    public void setStockNumber(int stockNumber) {
        this.stockNumber = stockNumber;
    }

    public int getStockWarn() {
        return stockWarn;
    }

    public void setStockWarn(int stockWarn) {
        this.stockWarn = stockWarn;
    }

    public double getMPrice() {
        return mPrice;
    }

    public void setMPrice(double mPrice) {
        this.mPrice = mPrice;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getLimitNumber() {
        return limitNumber;
    }

    public void setLimitNumber(int limitNumber) {
        this.limitNumber = limitNumber;
    }

    public int getSortIndex() {
        return sortIndex;
    }

    public void setSortIndex(int sortIndex) {
        this.sortIndex = sortIndex;
    }

    public int getIsHot() {
        return isHot;
    }

    public void setIsHot(int isHot) {
        this.isHot = isHot;
    }

    public int getEnshrineNumber() {
        return enshrineNumber;
    }

    public void setEnshrineNumber(int enshrineNumber) {
        this.enshrineNumber = enshrineNumber;
    }

    public int getSaleNumber() {
        return saleNumber;
    }

    public void setSaleNumber(int saleNumber) {
        this.saleNumber = saleNumber;
    }

    public int getVoucherNumber() {
        return voucherNumber;
    }

    public void setVoucherNumber(int voucherNumber) {
        this.voucherNumber = voucherNumber;
    }

    public int getSaleTimeType() {
        return saleTimeType;
    }

    public void setSaleTimeType(int saleTimeType) {
        this.saleTimeType = saleTimeType;
    }

    public long getSaleDtm() {
        return saleDtm;
    }

    public void setSaleDtm(long saleDtm) {
        this.saleDtm = saleDtm;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public int getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(int deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public int getIsEnshrine() {
        return isEnshrine;
    }

    public void setIsEnshrine(int isEnshrine) {
        this.isEnshrine = isEnshrine;
    }

    public int getStockStatus() {
        return stockStatus;
    }

    public void setStockStatus(int stockStatus) {
        this.stockStatus = stockStatus;
    }

    public List<?> getGoodsProperty() {
        return goodsProperty;
    }

    public void setGoodsProperty(List<?> goodsProperty) {
        this.goodsProperty = goodsProperty;
    }

    public List<GoodsFileEntity> getGoodsFile() {
        return goodsFile;
    }

    public void setGoodsFile(List<GoodsFileEntity> goodsFile) {
        this.goodsFile = goodsFile;
    }

    public List<?> getOrderVoucher() {
        return orderVoucher;
    }

    public void setOrderVoucher(List<?> orderVoucher) {
        this.orderVoucher = orderVoucher;
    }

    public List<SkuMapEntity> getSkuMap() {
        return skuMap;
    }

    public void setSkuMap(List<SkuMapEntity> skuMap) {
        this.skuMap = skuMap;
    }

    public List<SkuEntity> getSku() {
        return sku;
    }

    public void setSku(List<SkuEntity> sku) {
        this.sku = sku;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(goodsId);
        dest.writeInt(supplierId);
        dest.writeInt(shopId);
        dest.writeInt(classifyId);
        dest.writeInt(customClassifyId);
        dest.writeInt(brandId);
        dest.writeInt(goodsClassify);
        dest.writeInt(goodsType);
        dest.writeString(goodsSn);
        dest.writeString(goodsName);
        dest.writeString(goodsFullName);
        dest.writeString(goodsPic);
        dest.writeString(goodsDesc);
        dest.writeString(goodsSign);
        dest.writeString(unit);
        dest.writeInt(stockType);
        dest.writeInt(stockNumber);
        dest.writeInt(stockWarn);
        dest.writeDouble(mPrice);
        dest.writeDouble(price);
        dest.writeInt(limitNumber);
        dest.writeInt(sortIndex);
        dest.writeInt(isHot);
        dest.writeInt(enshrineNumber);
        dest.writeInt(saleNumber);
        dest.writeInt(voucherNumber);
        dest.writeInt(saleTimeType);
        dest.writeLong(saleDtm);
        dest.writeInt(statusCode);
        dest.writeInt(deleteFlag);
        dest.writeInt(isEnshrine);
        dest.writeInt(stockStatus);
    }

    public static class GoodsFileEntity {
        private int    goodsFileId;
        private int    shopFileId;
        private int    goodsId;
        private int    goodsSkuId;
        private int    fileType;
        private String fileName;
        private Object fileSMd5;
        private String fileMd5;
        private int    goodsFileType;
        private Object comments;

        public int getGoodsFileId() {
            return goodsFileId;
        }

        public void setGoodsFileId(int goodsFileId) {
            this.goodsFileId = goodsFileId;
        }

        public int getShopFileId() {
            return shopFileId;
        }

        public void setShopFileId(int shopFileId) {
            this.shopFileId = shopFileId;
        }

        public int getGoodsId() {
            return goodsId;
        }

        public void setGoodsId(int goodsId) {
            this.goodsId = goodsId;
        }

        public int getGoodsSkuId() {
            return goodsSkuId;
        }

        public void setGoodsSkuId(int goodsSkuId) {
            this.goodsSkuId = goodsSkuId;
        }

        public int getFileType() {
            return fileType;
        }

        public void setFileType(int fileType) {
            this.fileType = fileType;
        }

        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public Object getFileSMd5() {
            return fileSMd5;
        }

        public void setFileSMd5(Object fileSMd5) {
            this.fileSMd5 = fileSMd5;
        }

        public String getFileMd5() {
            return fileMd5;
        }

        public void setFileMd5(String fileMd5) {
            this.fileMd5 = fileMd5;
        }

        public int getGoodsFileType() {
            return goodsFileType;
        }

        public void setGoodsFileType(int goodsFileType) {
            this.goodsFileType = goodsFileType;
        }

        public Object getComments() {
            return comments;
        }

        public void setComments(Object comments) {
            this.comments = comments;
        }
    }

}
